//
//  MovieDataView.m
//  UI_豆瓣项目
//
//  Created by dllo on 15/10/31.
//  Copyright (c) 2015年 关业达. All rights reserved.
//

#import "MovieDataView.h"
#import "UIImageView+WebCache.h"
@implementation MovieDataView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self xingqing];
    }
    return self;
}

- (void)xingqing
{
    self.movieImageView = [[UIImageView alloc] initWithFrame:CGRectMake(15, 15, 120, 180)];
//    self.movieImageView.backgroundColor = [UIColor redColor];
    [self addSubview:self.movieImageView];
    [_movieImageView release];
    
    self.ratingLable = [[UILabel alloc] initWithFrame:CGRectMake(205, 18, 50, 20)];
//    self.ratingLable.backgroundColor = [UIColor yellowColor];
    [self addSubview:self.ratingLable];
    [_ratingLable release];
    UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake(165, 18, 50, 20)];
    label1.text = @"评分:";
    [self addSubview:label1];
    [label1 release];
    
    
    self.rating_countLable = [[UILabel alloc] initWithFrame:CGRectMake(260, 18, 100, 20)];
//    self.rating_countLable.backgroundColor = [UIColor redColor];
    [self addSubview:self.rating_countLable];
    [_rating_countLable release];
    
    self.release_dateLable = [[UILabel alloc] initWithFrame:CGRectMake(165, 53, 150, 20)];
//    self.release_dateLable.backgroundColor = [UIColor yellowColor];
    [self addSubview:self.release_dateLable];
    [_release_dateLable release];
    
    self.runtimeLable = [[UILabel alloc] initWithFrame:CGRectMake(165, 93, 150, 20)];
//    self.runtimeLable.backgroundColor = [UIColor redColor];
    [self addSubview:self.runtimeLable];
    [_runtimeLable release];
    
    self.genresLable = [[UILabel alloc] initWithFrame:CGRectMake(165, 133, 150, 20)];
//    self.genresLable.backgroundColor = [UIColor yellowColor];
    [self addSubview:self.genresLable];
    [_genresLable release];
    
    self.countryLable = [[UILabel alloc] initWithFrame:CGRectMake(165, 173, 150, 20)];
//    self.countryLable.backgroundColor = [UIColor redColor];
    [self addSubview:self.countryLable];
    [_countryLable release];
    
    UILabel *label2 = [[UILabel alloc] initWithFrame:CGRectMake(15, 220, 100, 40)];
    label2.text = @"制作人";
    [self addSubview:label2];
    [label2 release];
    
    self.cactorsLable = [[UILabel alloc] initWithFrame:CGRectMake(15, 280, 345, 80)];
    self.cactorsLable.numberOfLines = 0;
    [self addSubview:self.cactorsLable];
    [_cactorsLable release];
    
    UILabel *label3 = [[UILabel alloc] initWithFrame:CGRectMake(15, 380, 100, 40)];
    label3.text = @"电影情节";
    [self addSubview:label3];
    [label3 release];
    
    self.plot_simpleLable = [[UILabel alloc] initWithFrame:CGRectMake(15, 430, 345, 200)];
    self.plot_simpleLable.numberOfLines = 0;
    [self addSubview:self.plot_simpleLable];
    [_plot_simpleLable release];
    
    
    
}

- (void)setBmovie:(Movie2 *)Bmovie
{
    if (_Bmovie != Bmovie) {
        [_Bmovie release];
        _Bmovie = [Bmovie retain];
    }
    self.ratingLable.text = self.Bmovie.rating;
    self.rating_countLable.text = self.Bmovie.rating_count;
    self.release_dateLable.text = self.Bmovie.release_date;
    self.runtimeLable.text = self.Bmovie.runtime;
    self.genresLable.text = self.Bmovie.genres;
    self.countryLable.text = self.Bmovie.country;
    self.cactorsLable.text = self.Bmovie.actors;
    self.plot_simpleLable.text = self.Bmovie.plot_simple;
    
    NSURL *url = [NSURL URLWithString:self.Bmovie.poster];
    [self.movieImageView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"1.jpg"]];
}




//@property (nonatomic, retain)UIImageView *movieImageView;
//@property (nonatomic, retain)UILabel *ratingLable;
//@property (nonatomic, retain)UILabel *rating_countLable;
//@property (nonatomic, retain)UILabel *release_dateLable;
//@property (nonatomic, retain)UILabel *runtimeLable;
//@property (nonatomic, retain)UILabel *genresLable;
//@property (nonatomic, retain)UILabel *countryLable;
//@property (nonatomic, retain)UILabel *cactorsLable;
//@property (nonatomic, retain)UILabel *plot_simpleLable;

//@property (nonatomic, copy)NSString *poster; //图片
//@property (nonatomic, copy)NSString *rating; // 评分
//@property (nonatomic, copy)NSString *rating_count; // 评论数
//@property (nonatomic, copy)NSString *release_date; // 上映时间
//@property (nonatomic, copy)NSString *runtime; //时长
//@property (nonatomic, copy)NSString *genres; // 电影类型
//@property (nonatomic, copy)NSString *country; //国家
//@property (nonatomic, copy)NSString *actors; // 制作人信息
//@property (nonatomic, copy)NSString *plot_simple; // 电影情节




/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
